|
![](/i/fill.gif) |
I've been tinkering a little with JOAL. JOAL is Java Bindings for OpenAL.
https://joal.dev.java.net/
OpenAL is a cross-platform 3D audio API appropriate for use with gaming
applications and many other types of audio applications.
http://www.openal.org/
The point of it all is that I've attached sound emitters (so-called sources)
to some points in my POV-Ray scene and written a java program to "render"
the sound. This is my first test of the system. View the animation with your
speakers turned on of course.
There seems to be a little silence in the start and end of the animation - I
don't know why.
The complete scene file for the attached animation is below.
// +kf10 +kc +kff300
#declare camera_location = <0,0.3,1.2-0.5*clock>;
#declare camera_forward = z+0.1*x*clock;
#declare camera_up = y;
#declare ship1_translate = <sin(clock*2*pi/5)*10,0,1>;
#declare ship2_translate = <1,0.6,cos(clock*2*pi/5)*10>;
camera {
location camera_location
look_at camera_location+camera_forward
up camera_up
}
light_source {<1,2,-3>*1000, color 0.5*<1,1,0.7>}
light_source {<0,3,-1>*1000, color 1*<0.7,0.7,1>}
sky_sphere {
pigment {gradient y color_map {[0,rgb 1][1,blue 1]}}
}
superellipsoid {
<0.2,0.2> scale <0.3,0.2,0.2> translate ship1_translate+0.2*y
pigment {blue 1} finish {reflection 0.2}
}
sphere {
0, 1 scale <0.2,0.2,0.4> translate ship2_translate
pigment {red 1} finish {reflection 0.2}
}
plane {y, 0 pigment {checker rgb 1, rgb 0.1 scale 0.2}}
#include "povsound.inc"
// START POVSOUND
sound_start("soundtest.txt")
sound_set_time(clock*1000)
sound_set_gain(0.5)
sound_set_dobbler_factor(1.0)
sound_set_dobbler_velocity(100)
sound_set_listener(camera_location,camera_forward,camera_up)
// name starttime endtime translate gain pitch
sound_point("ship1", 1000*0, 1000*10, ship1_translate, 2.0, 1.0)
// name sound_filename time
sound_point_loop("ship1","wavdata/engine.wav",1000*0)
// name starttime endtime translate gain pitch
sound_point("ship2", 1000*0, 1000*10, ship2_translate, 1.0, 1.0)
// name sound_filename time
sound_point_loop("ship2","wavdata/hovercraft.wav",1000*0)
sound_end()
// END POVSOUND
Rune
--
3D images and anims, include files, tutorials and more:
rune|vision: http://runevision.com
POV-Ray Ring: http://webring.povray.co.uk
Post a reply to this message
Attachments:
Download '3d_sound_1.mpg' (631 KB)
|
![](/i/fill.gif) |